From: Keir Fraser Date: Wed, 11 May 2011 11:58:04 +0000 (+0100) Subject: Simplify and build-fix (for some gcc versions) radix_tree_int_to_ptr(). X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10373 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=b004883e29bbedb6c9f01a5e926e90f3effe28fd;p=xen.git Simplify and build-fix (for some gcc versions) radix_tree_int_to_ptr(). Signed-off-by: Keir Fraser --- diff --git a/xen/include/xen/radix-tree.h b/xen/include/xen/radix-tree.h index 54fd7c1477..15d88a2844 100644 --- a/xen/include/xen/radix-tree.h +++ b/xen/include/xen/radix-tree.h @@ -181,8 +181,9 @@ static inline void radix_tree_replace_slot(void **pslot, void *item) */ static inline void *radix_tree_int_to_ptr(int val) { - ASSERT((val <= (LONG_MAX >> 2)) && (val >= (LONG_MIN >> 2))); - return (void *)(((long)val << 2) | 0x2ul); + long _ptr = ((long)val << 2) | 0x2l; + ASSERT((_ptr >> 2) == val); + return (void *)_ptr; } static inline int radix_tree_ptr_to_int(void *ptr)